#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<assert.h>

char* my_strcpy(char* dest, const char* src)
{
	char* set = dest;
	while (*src != '\0')
	{
		*dest = *src;
		dest++;
		src++;
	}
	return  set;
}

char* my_strcat(char* dest, const char* src)
{
	assert(dest && src);
	char* set = dest;
	while (*dest != '\0')
	{
		dest++;
	}
	while (*src != '\0')
	{
		*dest = *src;
		dest++;
		src++;
	}
	*dest = '\0';
	return set;

}

size_t my_strlen(const char *ptr)
{
	assert(ptr);
	size_t count = 0;
	while (*ptr != '\0')
	{
		count++;
		ptr++;
	}
	return count;
}




int main()
{
	char arr1[] = "abcdef";
	char arr2[20] = { 0 };
	char arr3[20] = "aadd";
	size_t r = my_strlen(arr1);
	my_strcpy(arr2, arr1);
	my_strcat(arr3, arr1);
	printf("%d\n", r);
	for (int i = 0;i < 6;i++)
	{
		printf("%c", arr2[i]);
	}
	printf("\n");
	for (int j = 0;j < 10;j++)
	{
		printf("%c", arr3[j]);
	}


	return 0;
}
